<?php

class myUser extends sfGuardSecurityUser
{
  public function equals($obj)
  {
    if ($this->isAnonymous()) return false;

    $myID = $this->getGuardUser()->getId();
    if ($obj instanceof sfGuardSecurityUser)
      return $myID == $obj->getGuardUser()->getId();

    if ($obj instanceof sfGuardUser)
      return $myID == $obj->getId();

    return false;
  }
}
